package cn.org.eshow.webapp.action.response;


import cn.org.eshow.model.UserCoupon;

import java.util.Date;

/**
 * 购物车及药品
 */
public class UserCouponResponse {

    private Integer id = 0;
    private Date addTime = new Date();// 添加时间
    private Date updateTime = new Date();// 更新时间
    private Integer state;//状态（0未使用，1已使用）
    private UserSimpleResponse user;// 用户
    private CouponResponse coupon;//红包


    public UserCouponResponse() {
    }

    public UserCouponResponse(UserCoupon userCoupon) {
        this.setId(userCoupon.getId());
        this.setAddTime(userCoupon.getAddTime());
        this.setUpdateTime(userCoupon.getUpdateTime());
        this.setState(userCoupon.getState());
        if (userCoupon.getCoupon() != null) {
            this.coupon = new CouponResponse(userCoupon.getCoupon());
        }
        if (userCoupon.getUser() != null) {
            this.user = new UserSimpleResponse(userCoupon.getUser());
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public UserSimpleResponse getUser() {
        return user;
    }

    public void setUser(UserSimpleResponse user) {
        this.user = user;
    }

    public CouponResponse getCoupon() {
        return coupon;
    }

    public void setCoupon(CouponResponse coupon) {
        this.coupon = coupon;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
